﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CKS.Core.Framework
{
    public static partial class Ext
    {
        public static bool CatchAction(this System.Action action, string logTitle = "")
        {
            try
            {
                action();
                return true;
            }
            catch (Exception ex)
            {
                LogHelper.WriteErrorLog($"{logTitle} 异常 {ex.Message}");
                return false;
            }
        }
    }
}
